﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace MQTTTool.Page
{
    public partial class Hint : Form
    {
        public Hint(string msg,bool isPass = true)
        {
            InitializeComponent();

            label1.Text = msg;
            if (!isPass)
            {
                label1.ForeColor = Color.Red;
            }
            CloseHint();
        }

        /// <summary>
        /// 3秒后关闭
        /// </summary>
        private void CloseHint()
        {
            Task.Factory.StartNew(() =>
            {
                Thread.Sleep(3000);
                this.Invoke(new Action(() => {
                    this.Close();
                }));
                
            });
        }

        private void Hint_Load(object sender, EventArgs e)
        {

        }
    }
}
